<div class="previews view">
<h2><?php  
	$ar=explode("/",$preview['Preview']['route']);
	$pos=strrpos($preview['Preview']['route'],"v=")+1;	
	$codigo_video=substr($preview['Preview']['route'],$pos+1,11);
	//echo $codigo_video;
	echo __('Avance'); 
	?></h2>
	<dl>
		<!--dt><?php echo __('Id'); ?></dt>
		<dd>
			<?php echo h($preview['Preview']['id']); ?>
			&nbsp;
		</dd-->
		<dt><?php echo __('Nombre'); ?></dt>
		<dd>
			<?php echo h($preview['Preview']['name']); ?>
			&nbsp;
		</dd>
		<dt><?php echo __('Descripción'); ?></dt>
		<dd>
			<?php echo h($preview['Preview']['description']); ?>
			&nbsp;
		</dd><!--?php //$arg = explode('/watch?v=',$preview['Preview']['route']); echo str_replace('s','',$arg[0]).'/'.'embed/'.$arg[1]?-->
		<dt><?php echo __('Video youtube'); ?></dt>
		<dd><section>
		<div id="rep">
		<iframe title="YouTube video player" width="480" height="390" src="<?php echo 'http://www.youtube.com/embed/'.$codigo_video?>" frameborder="0" allowfullscreen></iframe>
<!--iframe title="YouTube video player" width="480" height="390" src="<?php $arg = explode('/watch?v=',$preview['Preview']['route']); echo str_replace('s','',$arg[0]).'/'.'embed/'.$arg[1]?>" frameborder="0" allowfullscreen></iframe>
</div>
		<!--embed src="http://www.youtube.com/embed/XzbPezkHIb8" quality=high width="640px" height="385px" type="application/x-shockwave-flash" allowfullscreen="true" allownetworking="internal" autoplay="false" wmode="transparent"></embed-->
		</section>
			<?php echo h($preview['Preview']['route']); ?>
			&nbsp;
		</dd>
		<dt><?php echo __('Entrega'); ?></dt>
		<dd>
			<?php echo $this->Html->link($preview['Presentation']['name'], array('controller' => 'presentations', 'action' => 'view', $preview['Presentation']['id'])); ?>
			&nbsp;
		</dd>
		<dt><?php echo __('Archivo'); ?></dt>
		<dd>
			<?php echo $this->Html->link($preview['Upload']['filename'], array('controller' => 'uploads', 'action' => 'view', $preview['Upload']['id'])); ?>
			&nbsp;
		</dd>
	</dl>
</div>
<div class="actions">
	<h3><?php echo __('Acciones'); ?></h3>
	<ul>
		<?php if($this->Session->read('Auth.User.role_id')=='1'): ?>			
		<li><?php echo $this->Form->postLink(__('Borrar'), array('action' => 'delete', $this->Form->value('Preview.id')), null, __('Are you sure you want to delete # %s?', $this->Form->value('Preview.id'))); ?></li>
		<li><?php echo $this->Html->link(__('Lista de avances'), array('action' => 'index')); ?></li>
		<li><?php echo $this->Html->link(__('Lista de presentaciones'), array('controller' => 'presentations', 'action' => 'index')); ?> </li>
		<li><?php echo $this->Html->link(__('Nueva presentación'), array('controller' => 'presentations', 'action' => 'add')); ?> </li>
		<li><?php echo $this->Html->link(__('Lista de subidas'), array('controller' => 'uploads', 'action' => 'index')); ?> </li>
		<li><?php echo $this->Html->link(__('Nueva subida'), array('controller' => 'uploads', 'action' => 'add')); ?> </li>
		<?php endif; ?>	
		<?php if($this->Session->read('Auth.User.role_id')=='6'): ?>	
			<li><?php echo $this->Html->link(__('Avances'), array('controller' => 'previews', 'action' => 'index')); ?> </li>
		<?php endif; ?>		
	</ul>
</div>
